package day07;

import java.util.Scanner;

public class Aoo {
    public static void main(String[] args) {
        double []scores=date();
        double total=calTotal(scores);
        double ufo=ufo(total,scores);
    }
    public static double[] date (){
        double []a=new double[6];
        for (int i=0;i< a.length;i++){
            Scanner scan=new Scanner(System.in);
            System.out.println("请输入第"+(i+1)+"个评委的成绩");
            a[i]=scan.nextDouble();
        }
        return a;
    }
    public static double calTotal(double[]scores){
        double total=0.0;
        double max=scores[0];
        double nix=scores[0];
        for (int i=0;i< scores.length;i++){
            if (scores[i]>max){
                max=scores[i];
            }
            if (scores[i]<nix){
                nix=scores[i];
            }
            total+=scores[i];
        }
        return total-max-nix;
    }
    public static double ufo(double total,double[]scores){
        return total/(scores.length-2);
    }
}
